class Solution {
public:
    int minChanges(int n, int k)
    {
        return (n & k) != k ? -1 : popcount((unsigned int)n) - popcount((unsigned int)k);
    }
};